//LazySingleton2Test.java
package singletonAndMultiton;

/**
 * @author:youtubezou
 * @version:2012-7-13
 */
public class LazySingleton2Test {
	public static void main(String[] args) {
		
		StringBuffer buf = new StringBuffer();
		buf.append("test");
		buf = buf.append("assign");
		System.out.println(buf);
		
		String str = "test";		
		str = str + str;		
		System.out.println(str);
		
		System.out.println("main()");
		System.out.println(LazySingleton2.getInstance());
		Thread1 thread1 = new Thread1();

		for (int i = 0; i < 10; i++)
			new Thread(thread1).start();
	}
}

class Thread1 implements Runnable {
	private static int count = 0;

	public void run() {
		System.out.println("this is thread: " + count++);
	}

}
